﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    NewsList
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table>
        <% List<MvcApplication2.Models.NewsModels> newsList = ViewData["newslist"] as List<MvcApplication2.Models.NewsModels>; %>
        <% foreach (MvcApplication2.Models.NewsModels item in newsList)
           { %>
        <tr>
            <td>
                <%= Html.ActionLink("修改", "NewsEdit", new { id=item.Id }) %>
                |
                <%= Html.ActionLink("详情", "NewsDetails", new {  id=item.Id })%>
                |
                <%= Html.ActionLink("删除", "Delete", new { id = item.Id })%>
            </td>
            <td>
                <%= item.Title %>
            </td>
            <td>
                <%= String.Format("{0:g}", item.CreateTime) %>
            </td>
            <td>
                <%= item.Content %>
            </td>
        </tr>
        <% } %>
    </table>
</asp:Content>
